<template>
  <div class="big-conter">
    <!-- 头部 -->
    <div class="y-nav">
      <span class="y-tatle">设备检测系统</span>
    </div>
    <!-- 内容 -->
    <div class="y-conter">
      <div class="y-top-div">
        <div class="div-1"></div>
        <div class="div-2"></div>
        <div class="div-3"></div>
        <div class="div-4"></div>
        <img class="y-img" src="../../static/img/1.jpg.png" alt />
      </div>
    </div>
    <div class="fext">
      <div class="y-inp-1">
        <span class="font-size1">门禁设备</span>
        <div class="font-size2">
          <div class="font-size2-1" v-for="(item,index) in door" :key="index">
            <div class="door-1">{{item.equipment_name}}</div>
            <div class="door-2">
              <span v-if="item.equipment_status=='1'" class="door2-1" style="background:green"></span>
              <span v-else class="door2-1" style="background:red"></span>
            </div>
          </div>
        </div>
      </div>
      <div class="y-inp-2">
        <span class="font-size1">考勤设备</span>
        <div class="font-size2">
          <div class="font-size2-1" v-for="(item,index) in kq" :key="index">
            <div class="door-1">{{item.equipment_name}}</div>
            <div class="door-2">
              <span v-if="item.equipment_status=='1'" class="door2-1" style="background:green"></span>
              <span v-else class="door2-1" style="background:red"></span>
            </div>
          </div>
        </div>
      </div>
      <div class="y-inp-3">
        <span class="font-size1">监控设备</span>
        <div class="font-size2">
          <div class="font-size2-1" v-for="(item,index) in jk" :key="index">
            <div class="door-1">{{item.equipment_name}}</div>
            <div class="door-2">
              <span v-if="item.equipment_status=='1'" class="door2-1" style="background:green"></span>
              <span v-else class="door2-1" style="background:red"></span>
            </div>
          </div>
        </div>
      </div>
      <div class="y-inp-4">
        <span class="font-size1">环境设备</span>
        <div class="font-size2">
          <div class="font-size2-1" v-for="(item,index) in hj" :key="index">
            <div class="door-1">{{item.equipment_name}}</div>
            <div class="door-2">
              <span v-if="item.equipment_status=='1'" class="door2-1" style="background:green"></span>
              <span v-else class="door2-1" style="background:red"></span>
            </div>
          </div>
        </div>
      </div>
      <div class="y-inp-5">
        <span class="font-size1">车辆识别设备</span>
        <div class="font-size2">
          <div class="font-size2-1" v-for="(item,index) in car" :key="index">
            <div class="door-1">{{item.equipment_name}}</div>
            <div class="door-2">
              <span v-if="item.equipment_status=='1'" class="door2-1" style="background:green"></span>
              <span v-else class="door2-1" style="background:red"></span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import http from "../api";
export default {
  data() {
    return {
      door: [],
      kq: [],
      jk: [],
      hj: [],
      car:[]
    };
  },
  mounted() {
    // http.sel
    http.sel({ equipment_type_id: "1" }).then((res) => {
      console.log("设备1", res);
      this.door = res.data;
      console.log(this.door);
    });
    http.sel({ equipment_type_id: "2" }).then((res) => {
      console.log("设备2", res);
      this.kq = res.data;
      console.log(this.kq);
    });
    http.sel({ equipment_type_id: "3" }).then((res) => {
      console.log("设备3", res);
      this.jk = res.data;
      console.log(this.jk);
    });
    http.sel({ equipment_type_id: "5" }).then((res) => {
      console.log("设备4", res);
      this.hj = res.data;
      console.log(this.hj);
    });
      http.sel({ equipment_type_id: "6" }).then((res) => {
      console.log("设备4", res);
      this.car = res.data;
      console.log(this.car);
    });
  },
};
</script>
<style scoped>
.big-conter {
  width: 100%;
  height: 660px;
  background: white;
}
.y-nav {
  width: 100%;
  height: 60px;
  line-height: 60px;
  border: 1px solid #eee;
}
.y-conter {
  width: 100%;
  height: 80px;
}
.y-tatle {
  font-size: 20px;
  font-weight: bold;
  padding-left: 30px;
}
.y-top-div {
  width: 70%;
  height: 100px;
  margin: 200px auto;
  border-top: 3px solid #36c6f1;
  position: relative;
  z-index: 1;
}
.div-1,
.div-2,
.div-3 {
  width: 24.6%;
  height: 80px;
  display: inline-block;
  border-left: 3px solid #18c5fa;
  box-sizing: border-box;
}

.div-4 {
  width: 24.7%;
  height: 80px;
  display: inline-block;
  border-left: 3px solid #18c5fa;
  border-right: 3px solid #18c5fa;
  box-sizing: border-box;
}
.y-img {
  position: absolute;
  top: -170px;
  right: 325px;
  z-index: 1000;
}
.fext {
  width: 90%;
  display: flex;
  /* height: 300px; */
  /* margin: 20px auto; */
}
.y-inp-1 {
  text-align: center;
  width: 15%;
  height: 50px;
  margin-left: 110px;
  margin-top: 10px;
  /* display: inline-block; */
}
.y-inp-2 {
  width: 15%;
  height: 50px;
  margin-left: 50px;
  text-align: center;
  margin-top: 10px;
  /* display: inline-block; */
}
.y-inp-3 {
  width: 15%;
  height: 50px;
  text-align: center;
  margin-left: 50px;
  margin-top: 10px;
  /* display: inline-block; */
}
.y-inp-4 {
  width: 15%;
  height: 50px;
  margin-left: 55px;
  text-align: center;
  margin-top: 10px;
  /* display: inline-block; */
}
.y-inp-5 {
  width: 15%;
  height: 50px;
  margin-left: 40px;
  text-align: center;
  margin-top: 10px;
  /* display: inline-block; */
}
.font-size1 {
  font-size: 17px;
  font-weight: bold;

  /* padding-top: 10px; */
}
.font-size2 {
  width: 200px;
  /* height: 170px; */
  margin-left: -10px;

  /* background-color: aquamarine; */
  margin-top: 10px;
  border: 1px solid gainsboro;
}
.font-size2-1 {
  height: 40px;
  width: 95%;
  margin-top: 5px;
  margin-bottom: 5px;
  margin-left: 5px;
  display: flex;
  background-color: rgb(238, 238, 238);
}
.door-1 {
  line-height: 40px;
  font-size: 14px;
  margin-left: 10px;
  
}
.door-2 {
  margin-left: 30px;
  line-height: 45px;
}
.door2-1 {
  display: inline-block;
  width: 14px;
  height: 14px;
  /* background-color: gold; */
  border-radius: 50%;
}
</style>